package system

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type SysPrescriptionRecordRouter struct{}

// InitSysPrescriptionRecordRouter 初始化 药方 路由信息
func (s *SysPrescriptionRecordRouter) InitSysPrescriptionRecordRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	sysPrescriptionRecordRouter := Router.Group("sysPrescriptionRecord").Use(middleware.OperationRecord())
	sysPrescriptionRecordRouterWithoutRecord := Router.Group("sysPrescriptionRecord")
	sysPrescriptionRecordRouterWithoutAuth := PublicRouter.Group("sysPrescriptionRecord")
	{
		sysPrescriptionRecordRouter.POST("createSysPrescriptionRecord", sysPrescriptionRecordApi.CreateSysPrescriptionRecord)             // 新建药方
		sysPrescriptionRecordRouter.DELETE("deleteSysPrescriptionRecord", sysPrescriptionRecordApi.DeleteSysPrescriptionRecord)           // 删除药方
		sysPrescriptionRecordRouter.DELETE("deleteSysPrescriptionRecordByIds", sysPrescriptionRecordApi.DeleteSysPrescriptionRecordByIds) // 批量删除药方
		sysPrescriptionRecordRouter.PUT("updateSysPrescriptionRecord", sysPrescriptionRecordApi.UpdateSysPrescriptionRecord)              // 更新药方
	}
	{
		sysPrescriptionRecordRouterWithoutRecord.GET("findSysPrescriptionRecord", sysPrescriptionRecordApi.FindSysPrescriptionRecord)       // 根据ID获取药方
		sysPrescriptionRecordRouterWithoutRecord.GET("getSysPrescriptionRecordList", sysPrescriptionRecordApi.GetSysPrescriptionRecordList) // 获取药方列表
		sysPrescriptionRecordRouterWithoutAuth.POST("checkStock", sysPrescriptionRecordApi.CheckStock)                                      // 核准库存
	}
	{
		sysPrescriptionRecordRouterWithoutAuth.GET("getSysPrescriptionRecordPublic", sysPrescriptionRecordApi.GetSysPrescriptionRecordPublic) // 药方开放接口
	}
}
